import { settings } from "../settings";
import { vendorActions } from "../Vendor";
import { Search, Trash2, Bolt } from "lucide-preact";
import { wordSignal } from "../signals";

const SearchIcon = () => {
  if (wordSignal.value === "") {
    const action = settings.value.actions.searchClick;
    if (action >= 20 && vendorActions.length > 0) {
      return vendorActions.find((ao) => ao.id === action)?.icon ?? <Search />;
    }
    switch (action) {
      case 0: {
        return <Search />;
      }
      case 1: {
        return <Bolt />;
      }
      case 2: {
        return <Trash2 />;
      }
    }
  } else {
    return <Search />;
  }
};

export default SearchIcon;
